import {debounce} from "./utils";
import BackTop from 'components/content/backTop/BackTop'//返回顶部按钮

export const itemListenerMixin = {
    data(){
        return {
            itemImgListener:null,
            refresh:null
        }
    },
    mounted(){
        this.refresh = debounce(this.$refs.scroll.refresh,200)
        this.itemImgListener = () => {
            this.refresh()
        }
        this.$bus.$on('itemImgLoad',this.itemImgListener)
        // console.log('我是混入中的内容')
    }
}


export const backTopMixin = {
    components:{
        BackTop
    },
    data(){
        return {
            isShowBackTop:false,//回到顶部按钮
        }
    },
    methods:{
        backClick(){
        // console.log('回到顶部')
        this.$refs.scroll.scrollTo(0,0,500)
        },
    }
}